﻿using SimulationPTSystem.EnvironmentDevice.Enums;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace SimulationPTSystem.EnvironmentDevice.Test.Converters
{
    public class DeviceTypeToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return "空";

            if (value is DeviceType deviceType)
            {
                switch (deviceType)
                {
                    case DeviceType.AudioPlay:
                        return "效果音频";
                    case DeviceType.Error:
                        return "不匹配";
                    case DeviceType.FanMachine:
                        return "风机";
                    case DeviceType.FlashLED:
                        return "频闪灯";
                    case DeviceType.FogMachine:
                        return "烟雾机";
                    case DeviceType.HighLED:
                        return "爆闪灯";
                    case DeviceType.SnowMachine:
                        return "雪花机";
                    case DeviceType.VibrateMachine:
                        return "震动舞台";
                    case DeviceType.VibrateMotor:
                        return "震动电机";
                }
            }

            return value.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
